
	
	package schedule.model;
	import java.util.ArrayList;   
	public class Advisor {            
		public int id;         
		public ArrayList<inputTime> availableTimes;          
		public milTimeSchedule milTime;
		public milTimeSchedule monMil;
		public milTimeSchedule tueMil;
		public milTimeSchedule wedMil;
		public milTimeSchedule thuMil;
		public milTimeSchedule friMil;		
		public booleanSchedule boolTime;  
		public String firstName, lastName, email;
		
		         
		public Advisor(int id){
			this.id = id;
			availableTimes = new ArrayList<inputTime>();
			initialize();		
		}
		
		public Advisor(int id, String firstName, String lastName) {
			super();
			this.id = id;
			this.firstName = firstName;
			this.lastName = lastName;
		}
		
		public void initialize(){
			monMil = new milTimeSchedule();
			tueMil = new milTimeSchedule();
			wedMil = new milTimeSchedule();
			thuMil = new milTimeSchedule();
			friMil = new milTimeSchedule();}

		public void addTime(inputTime newTime){                  
			availableTimes.add(newTime);          }         
		public void createSchedules(){                  
			createMyMilTime();                }          
		private void createMyMilTime(){                  
			milTimeSchedule mine = new milTimeSchedule();                  
			//appends hr and min together, as milTimeSchedule expects. i.e. sHr= 10 sMin= 45 turns into 1045                  
			for (inputTime a: availableTimes){                          
				StringBuffer sBuffer= new StringBuffer();                          
				sBuffer.append(a.startHr);                          
				sBuffer.append(a.startMn);                          
				int startTime = Integer.parseInt(sBuffer.toString());                          
				sBuffer.delete(0, sBuffer.length());                          
				sBuffer.append(a.endHr);                          
				sBuffer.append(a.endMn);                          
				int endTime = Integer.parseInt(sBuffer.toString());                                                                      
				mine.setAvailable(startTime, endTime);                  }                  
			milTime = mine;          }
		public String getFirstName() {
			return firstName;
		}
		public void setFirstName(String firstName) {
			this.firstName = firstName;
		}
		public String getLastName() {
			return lastName;
		}
		public void setLastName(String lastName) {
			this.lastName = lastName;
		}

		public String getEmail() {
			return email;
		}

		public void setEmail(String email) {
			this.email = email;
		}  
		
		
		}
	


